/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						 combat_castle.h

	$Header: /heroes4/combat_castle.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( COMBAT_CASTLE_H_INCLUDED )
#define COMBAT_CASTLE_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <iosfwd>
#include <string>
#include <vector>
#include "map_point.h"
#include "resource_traits.h"

// -------------------------------------------------------------
// combat castle item
// -------------------------------------------------------------
struct t_combat_castle_item
{
	std::string    name;
	t_map_point_2d position;
};

typedef std::vector<t_combat_castle_item> t_combat_castle_item_array;

// -------------------------------------------------------------
// combat castle
// -------------------------------------------------------------
class t_combat_castle
{
public:
	t_combat_castle_item_array const&	get_objects() const;
	bool								read( std::streambuf& stream );
	bool								write( std::streambuf& stream) const;
protected:
	t_combat_castle_item_array m_objects;
};

// -------------------------------------------------------------
// combat castle inlines
// -------------------------------------------------------------
inline t_combat_castle_item_array const& t_combat_castle::get_objects() const
{
	return m_objects;
}

inline bool read( std::streambuf& stream, t_combat_castle& castle )
{
	return castle.read( stream );
}

template <>
struct t_resource_traits< t_combat_castle >
{
	static char const prefix[];
	static char const extension[];
};

#endif // COMBAT_CASTLE_H_INCLUDED